#include "mainwindow.h"

MainWindow::MainWindow(QWidget *parent):QMainWindow(parent)
{
    stackedWidget = new QStackedWidget(this);
    setCentralWidget(stackedWidget);
    stackedWidget->setFixedSize(1024, 600);

    View_MainUI *UI_Main = new View_MainUI();
    View_UartUI *UI_Uart = new View_UartUI();

    stackedWidget->addWidget(UI_Main);
    stackedWidget->addWidget(UI_Uart);

    connect(UI_Main, &View_MainUI::switchToViewUart, [=]() {
        stackedWidget->setCurrentWidget(UI_Uart);
    });

    connect(UI_Uart, &View_UartUI::switchToViewMain, [=]() {
        stackedWidget->setCurrentWidget(UI_Main);
    });
}

MainWindow::~MainWindow() {}
